using System;

namespace Webshop20.Application
{
    public class  ApplicationServiceBase : IApplicationService
    {
        public event DomainFailureEvent DomainFailure;

        protected void HandleDomainMessage(DomainMessageSentEventArgs args, object sender)
        {
            if(DomainFailure == null)
                throw new InvalidOperationException("Event must be handeld.");

            DomainFailure(args, sender);
        }
    }
}